package com.qd.common.panda.domain.entity.commodity;

import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 商品描述
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class CommodityDescDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "商品ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "商品ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String commodityId;
    /**
     * 使用规则
     */
    private String useRules;
    /**
     * 商品描述
     */
    private String commodityDesc;
    /**
     * 添加时间
     */
    private LocalDateTime addTime;
    /**
     * 修改时间
     */
    private LocalDateTime updateTime;
    /**
     * 删除时间
     */
    private LocalDateTime deleteTime;
    /**
     * 是否删除
     */
    private Integer isDeleted;

    @Override
    public void freeData() {
        this.commodityId = null;
        this.useRules = null;
        this.commodityDesc = null;
        this.addTime = null;
        this.updateTime = null;
        this.deleteTime = null;
        this.isDeleted = null;
        super.freeData();
    }
}
